import QtQuick 2.12
import QtQuick.Controls 2.5
import QtQuick.Controls.Material 2.12

/*
TextField {
    id: textfield
    selectByMouse: true
    font.family: "Microsoft Yahei"
    font.pixelSize: 16
    property color backColor: skin.light ?  "#77FFFFFF" : "11000000"
    property color focusColor: Material.accent
    property color normalColor: Material.foreground

    topPadding: 3
    bottomPadding: 3
    leftPadding: 2
    rightPadding: 2

    background: Rectangle {
         implicitWidth: 200
         implicitHeight: 30
         color: backColor

         Rectangle {
            anchors.bottom: parent.bottom
            width: parent.width
            height: (textfield.hovered||textfield.focus) ? 2 : 1
            color: textfield.focus ? focusColor : normalColor
         }
    }
}
*/

TextField {
    id: cusTextField
    height: 30;
    hoverEnabled: enabled;
    selectByMouse: true;
    color: "#ffffff";
    maximumLength: 64;

    // selectionColor: "#ec4141";
    // selectedTextColor: "#ec4141";

    font.pixelSize: 15;
    font.family: "Microsoft Yahei";

    background: Rectangle {
        color: (cusTextField.enabled && !cusTextField.readOnly) ? "transparent" : "transparent";
        radius: 4;
        border.width: 1;
        // 边框颜色
        border.color: (cusTextField.enabled && !cusTextField.readOnly && (cusTextField.hovered || cusTextField.focus)) ? "#ec4141" : "#ec4141";
    }
}
